/**
 * 系统角色
 */
import { requestData } from '@/utils/request'

const prefix = '/sysRole'

const baseApi = {
  add(params) {
    return requestData({
      url: `${prefix}/add`,
      method: 'post',
      params
    })
  },
  get(id) {
    return requestData({
      url: `${prefix}/get/${id}`,
      method: 'get'
    })
  },
  bindAuth(params) {
    return requestData({
      url: `${prefix}/bindAuth`,
      method: 'post',
      params
    })
  },
  del(id) {
    return requestData({
      url: `${prefix}/del/${id}`,
      method: 'delete'
    })
  },
  disable(id) {
    return requestData({
      url: `${prefix}/disable/${id}`,
      method: 'post'
    })
  },
  enable(id) {
    return requestData({
      url: `${prefix}/enable/${id}`,
      method: 'post'
    })
  },
  menuTree(id) {
    return requestData({
      url: `${prefix}/menuTree/${id}`,
      method: 'get'
    })
  },
  bindMenu(params) {
    return requestData({
      url: `${prefix}/bindMenu`,
      method: 'post',
      params
    })
  },
  list(params) {
    return requestData({
      url: `${prefix}/list`,
      method: 'get',
      params
    })
  },
  listAll() {
    return requestData({
      url: `${prefix}/listAll`,
      method: 'get'
    })
  },
  update(data) {
    return requestData({
      url: `${prefix}/update`,
      method: 'put',
      data
    })
  }
}

export default baseApi
